import { RouteRecordRaw } from 'vue-router';
import MainLayout from 'layouts/MainLayout.vue'
const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    meta: { title: '登录', icon: 'el-icon-s-tools', dotNeedLogin: true },
    component: () => import('pages/Login.vue')
  },  
  {
    path: '/',
    component: MainLayout,
    children: [
      { 
        path: '', 
        name: 'Home',
        meta: { title: '主页', icon: 'home',caption:'' },
        component: () => import('pages/Index.vue') 
      },
      {
        path: '',
        name: 'ProfileIndex',
        meta: { title: '个人资料' },
        component: () => import('pages/profile/Index.vue')        
      }
    ],
  },
  {
    path: '/case',
    name: 'Case',
    meta: { title: '资料管理', icon: 'receipt_long',caption:'' },
    component: MainLayout,
    children: [
      { 
        path: 'index', 
        name: 'CaseIndex',
        meta: { title: '档案管理', icon: 'post_add',caption:'' },
        component: () => import('pages/case/Index.vue') 
      },
      { 
        path: 'detail', 
        name: 'CaseDetail',
        meta: { title: '档案详情' },
        component: () => import('pages/case/Detail.vue') 
      },
    ],
  },
  {
    path: '/file',
    component: MainLayout,
    meta: { title: '文件管理' },
    children: [
      {
        path: 'template',
        name: 'FileIndex',
        meta: { title: '模板管理' },
        component: () => import('pages/file/Index.vue')        
      }
    ]
  },
  {
    path: '/team',
    component: MainLayout,
    meta: { title: '团队管理' },
    children: [
      {
        path: 'role',
        name: 'RoleIndex',
        meta: { title: '角色管理', icon: 'groups',caption:'' },
        component: () => import('pages/role/Index.vue')        
      },
      {
        path: 'user',
        name: 'UserIndex',
        meta: { title: '用户管理', icon: 'person',caption:'' },
        component: () => import('pages/user/Index.vue')        
      }
    ]
  },
  {
    path: '/setting',
    name: 'Setting',
    component: MainLayout,
    meta: { title: '系统设置', icon: 'miscellaneous_services',caption:'' },
    children: [
      {
        path: '',
        name: 'SettingIndex',
        meta: { title: '配置管理', icon: 'storage',caption:'' },
        component: () => import('pages/setting/Index.vue')        
      }
    ]
  },
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/Error404.vue'),
  },
];

export default routes;
